using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class spt_patchlogMap : EntityTypeConfiguration<spt_patchlog>
    {
        public spt_patchlogMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Version)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Patch)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.task)
                .HasMaxLength(50);

            this.Property(t => t.Status)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("spt_patchlog");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Version).HasColumnName("Version");
            this.Property(t => t.Patch).HasColumnName("Patch");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.task).HasColumnName("task");
            this.Property(t => t.Results).HasColumnName("Results");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
